<!--
<div class="pull-right" style="width:auto;"><select style="width:auto;display:inline-block;" id="listrows" name="listrows" rel="{$listrows}" class="form-control input-sm"><option value="10" >10</option><option value="15">15</option><option value="20">20</option><option value="30">30</option><option value="40">40</option><option value="50">50</option><option value="60">60</option><option value="70">70</option><option value="80">80</option><option value="90">90</option><option value="100">100</option></select></div>
-->
<script type="text/javascript">
    function changeURLArg(url,arg,arg_val){
        var pattern=arg+'=([^&]*)';
        var replaceText=arg+'='+arg_val;
        if(url.match(pattern)){
            var tmp='/('+ arg+'=)([^&]*)/gi';
            tmp=url.replace(eval(tmp),replaceText);
            return tmp;
        }else{
            if(url.match('[\?]')){
                return url+'&'+replaceText;
            }else{
                return url+'?'+replaceText;
            }
        }
        return url+'\n'+arg+'\n'+arg_val;
    }
    var list_rows = $("#listrows").attr('rel');
    $("#listrows").val(list_rows);
    $("#listrows").change(function(){
        var every_listrows = $(this).val();
        var this_url = window.location.search;
        if(this_url.indexOf("listrows") > 0){
            window.location = changeURLArg(this_url,'listrows',every_listrows);
        }else{
            window.location = this_url+"&listrows="+every_listrows;
        }
    });
    $('.small_window').find('a').off().on('click',function () {
        let url =$(this).attr('href');
        $('#dialog-role-owner').dialog('open');
        $('#dialog-role-owner').load(url);
        return false;
    })
    $(document).ready(function () {
        $('.small_window').find('select').each(function () {
            $(this).removeAttr('onchange');
        });
    });
    $('.small_window').find('select').on('change',function () {
        let url = $(this).val();
        $('#dialog-role-owner').dialog('open');
        $('#dialog-role-owner').load(url);
    })
</script>
